package com.example.springcloudeurekaserverproducer.mybatis.interceptor.dialect;



/**
 *  MySql 数据库分页语句组装实现
 * @ClassName: MySqlDialect
 * @Description: TODO(这里用一句话描述这个类的作用)
 * @author lanyuansong
 * @date 2018年7月11日
 */
public class MySqlDialect implements IDialect {

    @Override
    public String buildPaginationSql(String originalSql, int offset, int limit) {
        StringBuilder sql = new StringBuilder(originalSql);
        sql.append(" LIMIT ").append(offset-1).append(",").append(limit);
        return sql.toString();
    }
    public static void main(String[] args) {
		String sql = "select * FROM sys_user WHERE TAC_CHECK='UC99'";
		System.out.println(new MySqlDialect().buildPaginationSql(sql, 0, 100));
	}
}
